﻿using FreeSql.DataAnnotations;
using Jumei.Common.BaseModel;
using Jumei.Model.Business.MemberManage;
using System;

namespace Jumei.Model.Business.OrdersManage
{

    /// <summary>
    /// 售后申请表
    /// </summary>
    [Table(Name = "or_order_services")]
    public class OrderServicesEntity : EntityFull, ITenant
    {
        /// <summary>
        /// 租户Id
        /// </summary>
        [Column(Position = -10)]
        public long? TenantId { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public long OrdersId { get; set; }

        public OrdersEntity Orders { get; set; }

        /// <summary>
        /// 售后类型 
        /// 0：退款退货 
        /// 1：退款 
        /// 2：换货
        /// </summary>
        [Column(MapType = typeof(int))]
        public GoodsServiceType GoodsServiceType { get; set; } = 0;

        /// <summary>
        /// 退换货类型
        /// 数据由基础数据类型里取
        /// </summary>
        public int ServiceType { get; set; }

        /// <summary>
        /// 退换货原因
        /// </summary>
        [Column(StringLength = 600)]
        public string ServiceRemark { get; set; }

        /// <summary>
        /// 附件
        /// </summary>
        [Column(StringLength = -2)]
        public string ServiceAnnex { get; set; }

        /// <summary>
        /// 本次申请可退还的积分，由系统计算得出
        /// </summary>
        public int RefundScore { get; set; }

        /// <summary>
        /// 获得的积分可抵扣金额
        /// </summary>
        public decimal GetScoreMoney { get; set; }

        /// <summary>
        /// 售后单可退款金额
        /// </summary>
        public decimal RefundableMoney { get; set; }

        /// <summary>
        /// 店铺是否同意
        /// 1:同意 
        /// 0：不同意
        /// </summary>
        public bool IsShopAgree { get; set; }

        /// <summary>
        /// 店铺不同意原因
        /// 商家不同意原因
        /// </summary>
        [Column(StringLength = 600)]
        public string DisagreeRemark { get; set; }

        /// <summary>
        /// 用户收货地址id
        /// </summary>
        public long MemberAddressId { get; set; }
        public MemberAddressEntity MemberAddress { get; set; }


        /// <summary>
        /// 地区id
        /// </summary>
        public int AreaId { get; set; }

        /// <summary>
        /// 地区ID值列表
        /// </summary>
        [Column(StringLength = 255)]
        public string AreaIdPath { get; set; }

        /// <summary>
        ///收货人名称
        /// </summary>
        [Column(StringLength = 50)]
        public string ReceiverName { get; set; }

        /// <summary>
        ///收件人地址
        /// </summary>
        [Column(StringLength = 50)]
        public string ReceiverAddress { get; set; }

        /// <summary>
        ///收件人手机
        /// </summary>
        [Column(StringLength = 50)]
        public string ReceiverPhone { get; set; }

        /// <summary>
        /// 商家收货地区ID
        /// </summary>
        public int ShopAreaId { get; set; }

        /// <summary>
        /// 商家收货地区ID值列表
        /// </summary>
        [Column(StringLength = 255)]
        public string ShopAreaIdPath { get; set; }

        /// <summary>
        ///商家收货人
        /// </summary>
        [Column(StringLength = 50)]
        public string ShopReceiverName { get; set; }

        /// <summary>
        ///商家详细收货地址
        /// </summary>
        [Column(StringLength = 50)]
        public string ShopReceiverAddress { get; set; }

        /// <summary>
        ///收件人手机
        /// </summary>
        [Column(StringLength = 50)]
        public string ShopReceiverPhone { get; set; }

        /// <summary>
        /// 用户是否发货
        /// false：未发货 
        /// true ：已发货
        /// </summary>
        public bool IsUserSendGoods { get; set; } = false;

        /// <summary>
        /// 用户是否使用物流
        /// 0：无需物流 
        /// 1：物流
        /// </summary>
        public int ExpressType { get; set; } = 0;

        /// <summary>
        /// 快递商ID
        /// </summary>
        public int ExpressId { get; set; } = 0;

        /// <summary>
        /// 快递号
        /// </summary>
        [Column(StringLength = 200)]
        public string ExpressNo { get; set; }

        /// <summary>
        /// 商家是否收到货
        /// -1：拒收 
        /// 0：未收货 
        /// 1：已收货
        /// </summary>
        public int? IsShopAccept { get; set; }

        /// <summary>
        /// 商家拒收类型
        /// 数据由基础数据类型里取
        /// </summary>
        public int ShopRejectType { get; set; }

        /// <summary>
        /// 商家拒收原因,选择“其他”的时候填写文字
        /// </summary>
        [Column(StringLength = 600)]
        public string ShopRejectOther { get; set; }

        /// <summary>
        /// 商家拒收时的货物图片
        /// </summary>
        [Column(StringLength = 150)]
        public string ShopRejectImg { get; set; }

        /// <summary>
        /// 商家是否发货
        /// false：未发货 
        /// true：已发货
        /// </summary>
        public bool IsShopSend { get; set; } = false;

        /// <summary>
        /// 商家是否使用物流    
        /// 0：无需物流 
        /// 1：物流
        /// </summary>
        public int ShopExpressType { get; set; } = 0;

        /// <summary>
        /// 商家快递商ID
        /// </summary>
        public int ShopExpressId { get; set; } = 0;

        /// <summary>
        /// 商家快递单号	
        /// </summary>
        [Column(StringLength = 200)]
        public string ShopExpressNo { get; set; }

        /// <summary>
        /// 用户是否收到货	
        /// -1：拒收 
        /// 0：未收货 
        /// 1：已收货
        /// </summary>
        public int IsMemberAccept { get; set; }

        /// <summary>
        /// 用户拒收类型
        /// 数据由基础数据类型里取
        /// </summary>
        public int MemberRejectType { get; set; }

        /// <summary>
        /// 用户拒收原因
        /// 选择“其他”的时候填写文字
        /// </summary>
        [Column(StringLength = 200)]
        public string MemberRejectOther { get; set; }

        /// <summary>
        /// 是否结束 
        /// false：进行中 
        /// true:已结束
        /// </summary>
        public bool IsClose { get; set; } = false;

        /// <summary>
        /// 状态备注
        /// 0：待商家审核 
        /// 1：等待用户发货 
        /// 2：等待商家收货 
        /// 3：等待商家发货 
        /// 4：等待用户收货 
        /// 5：完成退款/退货 
        /// 6：商家已确认收货 
        /// 7：商家受理，等待管理员退款
        /// </summary>
        public ServiceStatusType ServiceStatus { get; set; }

        /// <summary>
        /// 商家受理期限
        /// </summary>
        public DateTime? ShopAcceptExpireTime { get; set; }

        /// <summary>
        /// 用户发货期限
        /// </summary>
        public DateTime? MemberSendExpireTime { get; set; }

        /// <summary>
        /// 商家收货期限
        /// </summary>
        public DateTime? ShopReceiveExpireTime { get; set; }

        /// <summary>
        /// 用户收货期限	
        /// </summary>
        public DateTime? MemberReceiveExpireTime { get; set; }

        /// <summary>
        /// 商家发货期限
        /// </summary>
        public DateTime? ShopSendExpireTime { get; set; }
    }
}
